//package at.ac.tuwien.infosys.dsg.daiosPlugins.axis2.axiom;
//
//import java.io.ByteArrayInputStream;
//import java.io.ByteArrayOutputStream;
//import java.io.IOException;
//import java.io.InputStream;
//import java.io.OutputStream;
//import java.io.PipedInputStream;
//import java.io.PipedOutputStream;
//import java.io.StringReader;
//import java.io.Writer;
//import java.util.Enumeration;
//import java.util.List;
//import java.util.logging.Logger;
//
//import javax.xml.stream.XMLInputFactory;
//import javax.xml.stream.XMLStreamException;
//import javax.xml.stream.XMLStreamReader;
//import javax.xml.stream.XMLStreamWriter;
//
//import org.apache.axiom.om.OMDataSource;
//import org.apache.axiom.om.OMElement;
//import org.apache.axiom.om.OMNamespace;
//import org.apache.axiom.om.OMOutputFormat;
//import org.apache.axiom.om.impl.llom.OMSourcedElementImpl;
//import org.apache.axiom.om.impl.serialize.StreamingOMSerializer;
//import org.apache.axiom.om.util.StAXUtils;
//import org.apache.commons.collections.iterators.ArrayIterator;
//
//import at.ac.tuwien.infosys.dsg.daios.exceptions.TypeErrorException;
//import at.ac.tuwien.infosys.dsg.daios.exceptions.UnsupportedClassException;
//import at.ac.tuwien.infosys.dsg.daios.framework.interfaces.IConstants;
//import at.ac.tuwien.infosys.dsg.daios.framework.structs.DaiosInputMessage;
//import at.ac.tuwien.infosys.dsg.daios.framework.structs.DaiosMessage;
//import at.ac.tuwien.infosys.dsg.daios.util.Utility;
//import at.ac.tuwien.infosys.dsg.daios.wsdl.AtomicTypesMapper;
//import at.ac.tuwien.infosys.dsg.daios.wsdl.interfaces.IWSDLMessage;
//import at.ac.tuwien.infosys.dsg.daios.wsdl.interfaces.IWSDLOperation;
//import at.ac.tuwien.infosys.dsg.daios.wsdl.interfaces.IWSDLPart;
//import at.ac.tuwien.infosys.dsg.daios.wsdl.interfaces.IWSDLType;
//import at.ac.tuwien.infosys.dsg.daios.wsdl.typesystem.WSDLTypeTree;
//
///**
// * This class is originally from the Axis2 AXIOM test cases. See
// * http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/impl/llom/OMSourcedElementTest.java?view=markup.
// * 
// * 
// * @author philipp
// *
// */
//public class DaiosDataSource implements OMDataSource {
//
//	private DaiosInputMessage actualMessage = null;
//	private String name = null;
//	private String uri = null;
//	private String prefix = null;
//	private IWSDLType wrapper = null;
//	private OMElementConverter converter = null;
//
//    public DaiosDataSource(DaiosInputMessage actualMessage, String name,
//    		String uri, String prefix, IWSDLType wrapper,
//    		OMElementConverter converter) {
//    	this.name = name;
//    	this.uri = uri;
//    	this.prefix = prefix;
//    	this.wrapper = wrapper;
//    	this.converter = converter;
//    	this.actualMessage = actualMessage;
//    }
//
//    public void serialize(OutputStream output, OMOutputFormat format) throws XMLStreamException {
//    	XMLStreamWriter xmlStreamWriter = StAXUtils.createXMLStreamWriter(output);
//        serialize(xmlStreamWriter);
//        xmlStreamWriter.flush();
//    }
//
//    public void serialize(Writer writer, OMOutputFormat format) throws XMLStreamException {
//        serialize(StAXUtils.createXMLStreamWriter(writer));
//    }
//
//    public void serialize(XMLStreamWriter xmlWriter)
//            throws XMLStreamException {
//    	
//    	converter.addOMPart(name, actualMessage,
//				uri, prefix, wrapper, xmlWriter);
//    	
//    }
//
//
//    public XMLStreamReader getReader() throws XMLStreamException {
//		ByteArrayOutputStream bos =
//			new ByteArrayOutputStream();
//		serialize(bos, new OMOutputFormat());
//		ByteArrayInputStream bis =
//			new ByteArrayInputStream(bos.toByteArray());
//		return StAXUtils.createXMLStreamReader(bis);
//    }
//	
//}
